mui.init({
	pullRefresh: {
		container: '#pullrefresh',
		down: { //下拉刷新
			callback: pulldownRefresh,
			style: mui.os.android ? "circle" : "default"
		}
	},
	beforeback: function() {
		appPage.closeLogin();
	}
})


mui.plusReady(function() {

})
//初始化图表
var option = {
	color: ['#3398DB'],
	tooltip: {
		trigger: 'axis',
		axisPointer: { // 坐标轴指示器，坐标轴触发有效
			type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
		}
	},
	grid: {
		x: 35,
		x2: 10,
		y: 30,
		y2: 25
	},
	xAxis: [{
		type: 'category',
		data: ['火警', '故障', '启动', '屏蔽', '反馈', '复位', '监管'],
		axisTick: {
			alignWithLabel: true
		},
		axisLine: {
            show: true,
            lineStyle: {
                color: '#363e83',
            }
        },
        axisLabel: {
            inside: false,
            textStyle: {
                color: '#bac0c0',
                fontWeight: 'normal',
                fontSize: '12',
            },
        }
	}],
	yAxis: [{
		type: 'value',
		axisLine: {
            show: true,
            lineStyle: {
                color: '#32346c',
            }
        },
        splitLine: {
            show: true,
            lineStyle: {
                color: '#32346c ',
            }
        },
        axisLabel: {
            textStyle: {
                color: '#bac0c0',
                fontWeight: 'normal',
                fontSize: '12',
            },
        }
	}],
	series: [{
		name: '直接访问',
		type: 'bar',
		barWidth: '30%',
		data: [10, 52, 200, 334, 390, 330, 220],
		itemStyle: {
            normal: {
                barBorderRadius: 30,
                color: new echarts.graphic.LinearGradient(
                    0, 0, 0, 1, [{
                            offset: 0,
                            color: '#00feff'
                        },
                        {
                            offset: 0.5,
                            color: '#027eff'
                        },
                        {
                            offset: 1,
                            color: '#0286ff'
                        }
                    ]
                )
            }
        }
	}]
};
var barChart = echarts.init(document.getElementById('barChart'));
barChart.setOption(option);

//拉取数据
function getList() {
	request("/Card/layoutBrandMenuPage", {
		playerid: storageUser.UId
	}, function(r) {
		log(r);
		if (r.code == -1) {
			appUI.showTopTip(r.msg);
			return;
		}
		render("#toolList", "toolListTep1", r);
		appPage.imgInit();
		//四个标签页二级
		mui(".mui-collapse-content").on("tap", "span", function() {
			if (this.dataset.href != '') {
				openNew(this.dataset.href, {
					type: "",
					BrandId: this.dataset.id
				});
			}

		})
	})
}

//下拉刷新具体业务实现
function pulldownRefresh() {
	setTimeout(function() {
		//下拉刷新结束
		getList();
		mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
		//重置上拉加载
		mui('#pullrefresh').pullRefresh().refresh(true);
		//重置页码
		page = 1;
	}, 1500)
}
